package be.dch.csv.validator;

import be.dch.exceptions.ValidationException;
import be.dch.util.StringUtils;

public class Optional implements CellValidator {

    private final transient CellValidator validator;

    public Optional(final CellValidator validator) {
	this.validator = validator;
    }

    public void validate(final String input) throws ValidationException {
	if (!StringUtils.isEmpty(input)) {
	    this.validator.validate(input);
	}

    }

}
